<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Benchmark results for methods in class org.directmemory.test2.MicroBenchmarks</title>

    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("jquery", "1.4.2");
      google.load('visualization', '1', {packages: ['barchart', 'columnchart', 'table']});
    </script>

    <style type="text/css">
		#content {
		  width: 800px ;
		  margin-left: auto;
		  margin-right: auto;
		}

		#chart {
		  width: 600px;
		  height: 400px;
		  margin-left: auto;
		  margin-right: auto;
		  margin-bottom: 10px;
		  display: block;
		}

		#help {
		  text-align: center;
		  margin-top: 10px;
		  font-size: .8em;
		  color: gray;
		}
		
		ul.expander {
	      display: inline;
          margin-left: 0;
          padding-left: 0;
          font-size: .8em;
		}

		ul.expander li {
		  margin-left: 0;
          list-style: none;
          display: inline;
		}

		ul.expander li:before {
          content: "\25BA\0020";  // 25B8
        }

        ul.expander li.expanded:before {
          content: "\25BC\0020";  // 25BE
        }
    </style>

    <script type="text/javascript">
      var horizontal = false;
      var view;
      var data;
      var table;

      function redrawChart() {
          var chart = (horizontal 
                  ? new google.visualization.BarChart(document.getElementById('chart'))
                  : new google.visualization.ColumnChart(document.getElementById('chart')));

          chart.draw(view, {
              legend: "none",
              titleY: view.getColumnLabel(1),
              colors: ['#8888FF'],
              min: 0.0,max: 1.0,
              showCategories: true,
              isStacked: false,
          });
      }

      function visualize(jsonData, className) {
        data = new google.visualization.DataTable(jsonData);

        table = new google.visualization.Table(document.getElementById('raw-data'));
        table.draw(data);

        view = new google.visualization.DataView(data);
        view.setColumns([0, 1]);
        redrawChart();

        google.visualization.events.addListener(table, 'sort',
			function(event) {
			  if (event.column > 0) {
				  view.setColumns([0, event.column]);
			  }

              view.setRows(data.getSortedRows([{column: event.column, desc: !event.ascending}]));
			  redrawChart();
		});
      }

      google.setOnLoadCallback(function() {
	        $.ajax({
	          url: "latest-microbench.json",
	          method: "GET",
	          success: function(data) {
	            visualize(data, "org.directmemory.test2.MicroBenchmarks");
	          }
	        });

          $("#properties").click(function () {
        	  $(this).toggleClass("expanded"); 
              $("#proplist").slideToggle();
          });

          $("#orientation").click(function () {
              $(this).toggleClass("expanded");
              horizontal = !horizontal; 
              redrawChart();
          });
      });
    </script>
  </head>

  <body style="font-family: Arial; margin: 30px;">
    <div id="content">
	    <h1>Benchmark results for methods in class org.directmemory.test2.MicroBenchmarks</h1>

        <ul class="expander"><li id="orientation" class="expanded"><a href="#">Orientation</a></li></ul>
	    <div id="chart" ></div>
	    <div id="raw-data"></div>

	    <div id="help">
	    Click on table headers to change the sorting order and redraw the chart.
	    </div>

	    <div>
	        <ul class="expander"><li id="properties"><a href="#">Properties</a></li></ul>
	        <pre id="proplist" style="display: none; background-color: #e0e0e0;">Run ID: 8
Run timestamp: 2011-08-15 22:02:49.42
JVM: 1.6.0_26-b03
OS: amd64
Custom key: hugemem-3m-largeA7k
</pre>
	    </div>
    </div>
  </body>
</html>
